package cn.java71.service;

import cn.java71.dao.GradeDao;
import cn.java71.dao.StudentDao;
import cn.java71.entity.Grade;
import cn.java71.util.MyBatisUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

/**
 * @author oldliu
 * @since 1.0
 */
public class GradeService {
    public List<Grade> findALL(){
        SqlSession sqlSession = MyBatisUtil.get();
        try {
            GradeDao dao = sqlSession.getMapper(GradeDao.class);
            return dao.findALL();
        }finally {
            MyBatisUtil.close(sqlSession);//模型
        }
    }
}
